package com.tjetc.util;

import lombok.Getter;

@Getter
public class Pager {
    private Integer pageNum;
    private Integer pageSize;
    private Integer recordCount;
    private Integer pageCount;
    private Integer start;

    public Pager(Integer pageNum, Integer pageSize, Integer recordCount) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.recordCount = recordCount;

        //计算总页数
        pageCount = recordCount / pageSize;
        if(recordCount % pageSize != 0)
            pageCount ++;
        start = (pageNum - 1) * pageSize;
    }
}
